<template>
    <div class="card-box">
      <template>
        <el-dialog :visible.sync="dialogVisible"  width="900px" title="请假详情信息" :close-on-click-modal="false">
            <div class="card-title">
                <span>请假详情</span>
            </div>
            <table class="customTable" cellspacing="0" :data="assessInfoData" align="center">
                <tr>
                    <td class="label">请假人姓名：</td>
                    <td >{{_assessInfoData.createName}}</td>
                    <td class="label">请假天数：</td>
                    <td >{{_assessInfoData.leaveDay}} 天</td>
                </tr>
                <tr>
                    <td class="label">开始时间：</td>
                    <td > {{_assessInfoData.startDate}}</td>
                    <td class="label">结束时间：</td>
                    <td> {{_assessInfoData.endDate}}</td>
                </tr>
                <tr>
                    <td class="label">请假原因：</td>
                    <td colspan="5">
                        {{_assessInfoData.leaveReason}}
                    </td>
                </tr>
            </table>

            <br/>
            <br/>
            <br/>
            <div class="card-title">
                <span>办理结果信息</span>
            </div>
            <div style="margin: 0 auto;padding: 0;">
                <el-table
                    :data="assessInfoDataTwo"
                    class="flowTable"
                    stripe
                    :header-cell-style="tableHeaderColor"
                    style="width: 100%">
                    <el-table-column label="业务类型" prop="busiType" align="center" width="100"/>
                    <el-table-column label="任务名称" prop="taskName" align="center" width="90"/>
                    <el-table-column label="办理结果" prop="operResult" align="center" width="90"/>
                    <el-table-column label="办理意见" prop="operIdea" align="center" width="150"/>
                    <el-table-column label="经办人" prop="operateName" align="center" width="90"/>
                    <el-table-column label="经办时间" prop="operateTime" align="center" width="150"/>
                </el-table>
            </div>
            <div slot="footer" class="dialog-footer">
                <el-button @click="closeDialog()">取 消</el-button>
            </div>
        </el-dialog>
      </template>
    </div>
</template>

<script>
    import {mapState} from 'vuex'
    import {getTaskResultByTaskCode,getById,qingjia} from "~/views/wy-flow/api/flowbusimain"

    export default {
        name:"view-look",
        data() {
            return {
                infoEdit: [true],
                infoEdit2: [true],
                loading: false,
                dialogVisible: false,
                assessInfoData: [
                ],
                assessInfoDataTwo: [
                ],
                enheng: {
                },
                countys:[
                    {value:"1",text:"手动"},
                    {value:"0",text:"自动"},
                ],
                busiTypeCodes:[],
                rowValue:'',
                rowName:"",
                hideId:false,
            }
        },
        computed: {
            ...mapState({
                user: state => state.user.user
            }),
            _assessInfoData(){
                return this.assessInfoData.length ? this.assessInfoData[0] : {}
            }
        },
        created: function(){
            // this.getSelectData()
        },
        methods: {
            tableHeaderColor({row,column,rowIndex,columnIndex}){
                return 'background-color:#FAFAFA;color:black;'
            },
            show(rowData){
                this.loading = false
                this.assessInfoData=[]
                this.assessInfoDataTwo=[]
                qingjia(rowData).then(response=>{
                    this.assessInfoData.push(Object.assign({},response.data.data))
                })
                getTaskResultByTaskCode(rowData).then(response=>{
                    for(var i=0;i<response.data.data.length;i++){
                        this.assessInfoDataTwo.push(Object.assign({},response.data.data[i]))
                        this.assessInfoDataTwo[i].isAuto=({value:"1",text:"自动"}, {value:"0",text:"手动"})
                        // this.assessInfoDataTwo[i].operResult=({value:0,text:"不通过"},{value:1,text:"通过"},{value:9,text:"返回受理"})
                        if(this.assessInfoDataTwo[i].operResult==1){
                            this.assessInfoDataTwo[i].operResult='通过'
                        }else if (this.assessInfoDataTwo[i].operResult==0){
                            this.assessInfoDataTwo[i].operResult='不通过'
                        }else if (this.assessInfoDataTwo[i].operResult==9){
                            this.assessInfoDataTwo[i].operResult='返回受理'
                        }
                    }
                })
                this.dialogVisible = true
            },
            closeDialog(){
                this.dialogVisible = false
            }
        }
    }
</script>
<style scoped lang='scss'>
    
    @include formWrap();
    .card-box{
        .card-title{
            margin-bottom: 20px;
        }
    }
</style>
